package com.studycloud.config;


import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author JP
 */
@Configuration
public class GetWayConfig
{
    @Bean
    public RouteLocator customRouteLocator(RouteLocatorBuilder builder)
    {
        RouteLocatorBuilder.Builder routes = builder.routes();

        return routes.route
                (
                "daidu_builder",
                r -> r.path("/guonei").uri("http://news.baidu.com/guonei")
        ).build();
    }
}
